import { Pipe, PipeTransform, Inject } from "@angular/core";

@Pipe({
  name: "status2text"
})
export class Status2textPipe implements PipeTransform {
  constructor(@Inject("ConfigService") private configService) {}
  transform(value: any, args?: any): any {
    const arr = this.configService[args];
    let ret = null;
    arr.forEach(d => {
      if (d.val === value) {
        ret = d.label;
      }
    });
    return ret;
  }
}
